package org.dudemonkey.jvm.concurrency.util;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class PrintUtil {
    public static void sleep(Integer secs){
        for (int i = 1; i <= secs; i++) {
            try {
                Thread.sleep(1000);
                //log.debug(String.format("Thread[---> %s ] has sleep %d seconds.",Thread.currentThread().getName(), i));
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    public static void print(){
        log.debug(String.format("Print thread [ ++ > %s ] is running .",Thread.currentThread().getName()));
    }

    public static void printContent(Object obj){
        log.debug(String.format("Print thread [ ++ > %s ]  , the content : ( %s ) .",Thread.currentThread().getName(),obj.toString()));
    }

}
